<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 3.9.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=7.4.2">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=7.4.2">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=7.4.2">
  <link rel="mask-icon" href="/images/logo.svg?v=7.4.2" color="#222">

<link rel="stylesheet" href="/css/main.css?v=7.4.2">


<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css?v=4.7.0">


<script id="hexo-configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Pisces',
    version: '7.4.2',
    exturl: false,
    sidebar: {"position":"left","display":"post","offset":12,"onmobile":false},
    copycode: {"enable":false,"show_result":false,"style":null},
    back2top: {"enable":true,"sidebar":false,"scrollpercent":false},
    bookmark: {"enable":false,"color":"#222","save":"auto"},
    fancybox: false,
    mediumzoom: false,
    lazyload: false,
    pangu: false,
    algolia: {
      appID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    },
    localsearch: {"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},
    path: '',
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    translation: {
      copy_button: '复制',
      copy_success: '复制成功',
      copy_failure: '复制失败'
    },
    sidebarPadding: 40
  };
</script>

  <meta name="description" content="FastDFS是一个开源的轻量级分布式文件系统，它对文件进行管理，功能包括：文件存储、文件同步、文件访问（文件上传、文件下载）等，解决了大容量存储和负载均衡的问题。">
<meta name="keywords" content="FastDFS">
<meta property="og:type" content="article">
<meta property="og:title" content="分布式文件系统FastDFS安装配置">
<meta property="og:url" content="http://chengg.top/2017/03/01/分布式文件系统FastDfs安装配置/index.html">
<meta property="og:site_name" content="CHENG&#39;s NOTES">
<meta property="og:description" content="FastDFS是一个开源的轻量级分布式文件系统，它对文件进行管理，功能包括：文件存储、文件同步、文件访问（文件上传、文件下载）等，解决了大容量存储和负载均衡的问题。">
<meta property="og:locale" content="zh-CN">
<meta property="og:updated_time" content="2019-10-23T14:34:12.038Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="分布式文件系统FastDFS安装配置">
<meta name="twitter:description" content="FastDFS是一个开源的轻量级分布式文件系统，它对文件进行管理，功能包括：文件存储、文件同步、文件访问（文件上传、文件下载）等，解决了大容量存储和负载均衡的问题。">

<link rel="canonical" href="http://chengg.top/2017/03/01/分布式文件系统FastDfs安装配置/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome: false,
    isPost: true,
    isPage: false,
    isArchive: false
  };
</script>

  <title>分布式文件系统FastDFS安装配置 | CHENG's NOTES</title>
  








  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-meta">

    <div>
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">CHENG's NOTES</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
  </div>

  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>
</div>


<nav class="site-nav">
  
  <ul id="menu" class="menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-fw fa-home"></i>首页</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-fw fa-tags"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-fw fa-th"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-fw fa-archive"></i>归档</a>

  </li>
        <li class="menu-item menu-item-music">

    <a href="/music/" rel="section"><i class="fa fa-fw fa-music"></i>歌单</a>

  </li>
        <li class="menu-item menu-item-movies">

    <a href="/movies" rel="section"><i class="fa fa-fw fa-video-camera"></i>影视</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/about/" rel="section"><i class="fa fa-fw fa-user"></i>关于</a>

  </li>
  </ul>

</nav>
</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content">
            

  <div class="posts-expand">
      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block " lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://chengg.top/2017/03/01/分布式文件系统FastDfs安装配置/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="https://tvax4.sinaimg.cn/crop.0.0.480.480.180/006ARivqly8fuwtj1v9edj30dc0dct9q.jpg">
      <meta itemprop="name" content="一叶不知秋丶">
      <meta itemprop="description" content="有人天生为王，有人落草为寇。">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="CHENG's NOTES">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          分布式文件系统FastDFS安装配置
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2017-03-01 15:21:39" itemprop="dateCreated datePublished" datetime="2017-03-01T15:21:39+08:00">2017-03-01</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/学习笔记/" itemprop="url" rel="index">
                    <span itemprop="name">学习笔记</span>
                  </a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <p>FastDFS是一个开源的轻量级分布式文件系统，它对文件进行管理，功能包括：文件存储、文件同步、文件访问（文件上传、文件下载）等，解决了大容量存储和负载均衡的问题。<br><a id="more"></a> </p>
<h3 id="1-下载安装libfastcommon"><a href="#1-下载安装libfastcommon" class="headerlink" title="1.下载安装libfastcommon"></a>1.下载安装libfastcommon</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">git clone https://github.com/happyfish100/libfastcommon.git</span><br><span class="line">cd libfastcommon/</span><br><span class="line">./make.sh</span><br><span class="line">./make.sh install</span><br></pre></td></tr></table></figure>
<h3 id="2-下载安装fastdfs"><a href="#2-下载安装fastdfs" class="headerlink" title="2.下载安装fastdfs"></a>2.下载安装fastdfs</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">wget https://github.com/happyfish100/fastdfs/archive/V5.05.tar.gz</span><br><span class="line">tar -zxvf V5.05.tar.gz</span><br><span class="line">cd V5.05</span><br><span class="line">./make.sh</span><br><span class="line">./make.sh install</span><br></pre></td></tr></table></figure>
<h3 id="3-执行安装"><a href="#3-执行安装" class="headerlink" title="3.执行安装"></a>3.执行安装</h3><p>默认会安装到/usr/bin中，并在/etc/fdfs中添加三个配置文件。<br>修改配置文件，将三个文件的名字去掉sample.<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">tracker.conf 中修改：</span><br><span class="line">base_path=/usr/lgip_fastdfs/fastdfs-tracker-log #用于存放日志。</span><br><span class="line">storage.conf 中修改：</span><br><span class="line">base_path=/usr/lgip_fastdfs/fastdfs-storage-log #用于存放日志。</span><br><span class="line">store_path0=/usr/lgip_fastdfs/fastdfs-file-save #存放数据  </span><br><span class="line">tracker_server=192.168.20.35:22122   #指定tracker服务器地址。  </span><br><span class="line">client.conf 中同样要修改：  </span><br><span class="line">base_path=/usr/lgip_fastdfs/fastdfs-client-log #用于存放日志。  </span><br><span class="line">tracker_server=192.168.20.35:22122   #指定tracker 服务器地址。  </span><br><span class="line">启动tracker和storage：  </span><br><span class="line">/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf （+restart为重启）  </span><br><span class="line">/usr/bin/fdfs_storaged /etc/fdfs/storage.conf （+restart为重启）</span><br><span class="line">ps -aux | grep fdfs #查看进程</span><br></pre></td></tr></table></figure></p>
<h3 id="4-测试是否安装成功："><a href="#4-测试是否安装成功：" class="headerlink" title="4.测试是否安装成功："></a>4.测试是否安装成功：</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">上传：/usr/bin/fdfs_upload_file /etc/fdfs/client.conf /usr/01.jpg  </span><br><span class="line">下载：/usr/bin/fdfs_download_file /etc/fdfs/client.conf   group1/M00/00/00/eSosZVfrMy2ADEcxAADS9IecoKQ527.jpg /usr/02.jpg  </span><br><span class="line">删除：/usr/bin/fdfs_delete_file /etc/fdfs/client.conf group1/M00/00/00/eSosZVfrLr6AfbmDAADS9IecoKQ093.jpg</span><br><span class="line">若上传成功，会显示文件地址： group1/M00/00/00/eSosZVfrMy2ADEcxAADS9IecoKQ527.jpg</span><br></pre></td></tr></table></figure>




    
    
    

      <footer class="post-footer">
             <div> 
    <div style="text-align:center;color: #ccc;font-size:14px;"> 
    ------------- 本文结束 感谢您的阅读 ------------- 
    </div> 
    </div>
    </div>
          <div class="post-tags">
              <a href="/tags/FastDFS/" rel="tag"># FastDFS</a>
          </div>

        

          <div class="post-nav">
            <div class="post-nav-next post-nav-item">
                <a href="/2017/02/25/Hexo多平台部署page/" rel="next" title="Hexo多平台部署page">
                  <i class="fa fa-chevron-left"></i> Hexo多平台部署page
                </a>
            </div>

            <span class="post-nav-divider"></span>

            <div class="post-nav-prev post-nav-item">
                <a href="/2017/04/09/使用阿里RAP搭建前端Mock Server/" rel="prev" title="使用阿里RAP搭建前端Mock Server">
                  使用阿里RAP搭建前端Mock Server <i class="fa fa-chevron-right"></i>
                </a>
            </div>
          </div>
      </footer>
    
  </article>
  
  
  

  </div>


          </div>
          

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#1-下载安装libfastcommon"><span class="nav-number">1.</span> <span class="nav-text">1.下载安装libfastcommon</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2-下载安装fastdfs"><span class="nav-number">2.</span> <span class="nav-text">2.下载安装fastdfs</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-执行安装"><span class="nav-number">3.</span> <span class="nav-text">3.执行安装</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#4-测试是否安装成功："><span class="nav-number">4.</span> <span class="nav-text">4.测试是否安装成功：</span></a></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <img class="site-author-image" itemprop="image" alt="一叶不知秋丶"
    src="https://tvax4.sinaimg.cn/crop.0.0.480.480.180/006ARivqly8fuwtj1v9edj30dc0dct9q.jpg">
  <p class="site-author-name" itemprop="name">一叶不知秋丶</p>
  <div class="site-description" itemprop="description">有人天生为王，有人落草为寇。</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">5</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">2</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">4</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2019 </span>
 
  <span class="author" itemprop="copyrightHolder">Hosted by Gitee/Coding Pages 一叶不知秋丶</span>
</div>

        












        
      </div>
    </footer>
  </div>

  
  <script src="/lib/jquery/index.js?v=2.1.3"></script>
  <script src="/lib/anime.min.js?v=3.1.0"></script>
  <script src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  <script src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
<script src="/js/utils.js?v=7.4.2"></script><script src="/js/motion.js?v=7.4.2"></script>
<script src="/js/schemes/pisces.js?v=7.4.2"></script>
<script src="/js/next-boot.js?v=7.4.2"></script>

  <script defer src="/lib/three/three.min.js"></script>
    <script defer src="/lib/three/canvas_lines.min.js"></script>


  


















  

  

  

</body>
</html>
